home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / HENSA / MATHS / PLPLOT / PLPLOT.ZIP / examples / tcl / x07.tcl < prev    next >
Text File  |  1994-08-09  |  1KB  |  66 lines

  1. # $Id: x07.tcl,v 1.2 1994/08/09 08:23:27 mjl Exp $
  2. # $Log: x07.tcl,v $
  3. # Revision 1.2  1994/08/09  08:23:27  mjl
  4. # Changed to new tclMatrix notation.
  5. #
  6. # Revision 1.1  1994/06/30  18:49:39  mjl
  7. # Tcl demo programs, which fully reproduce their x??c counterpart.
  8. #
  9. #----------------------------------------------------------------------------
  10. # PLplot Tcl demo #7
  11. #
  12. # After sourcing, just type "7".
  13. #----------------------------------------------------------------------------
  14.  
  15. proc 7 {} {
  16.  
  17.     matrix base i 17 = \
  18.     {0, 200, 500, 600, 700, 800, 900, \
  19.          2000, 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900}
  20.  
  21.     matrix x f 1
  22.     matrix y f 1
  23.  
  24.     plfontld 1
  25.     for {set l 0} {$l < 17} {incr l} {
  26.     pladv
  27.  
  28. # Set up viewport and window
  29.  
  30.     plcol 2
  31.     plvpor 0.15 0.95 0.1 0.9
  32.     plwind 0.0 1.0 0.0 1.0
  33.  
  34. # Draw the grid using plbox
  35.  
  36.     plbox "bcgt" 0.1 0 "bcgt" 0.1 0
  37.  
  38. # Write the digits below the frame
  39.  
  40.     plcol 15
  41.     for {set i 0} {$i <= 9} {incr i} {
  42.         plmtex "b" 1.5 [expr 0.1 * $i + 0.05] 0.5 $i
  43.     }
  44.  
  45.     set k 0
  46.     for {set i 0} {$i <= 9} {incr i} {
  47.  
  48. # Write the digits to the left of the frame
  49.  
  50.         plmtex "lv" 1.0 [expr (0.95 - 0.1 * $i)] 1.0 \
  51.         [expr [base $l] + 10*$i]
  52.  
  53.         for {set j 0} {$j <= 9} {incr j} {
  54.         x 0 = [expr 0.1 * $j + 0.05]
  55.         y 0 = [expr 0.95 - 0.1 * $i]
  56.  
  57. # Display the symbols
  58.  
  59.         plsym 1 x y [expr [base $l] + $k]
  60.         incr k
  61.         }
  62.     }
  63.     plmtex "t" 1.5 0.5 0.5 "PLPLOT Example 7 - PLSYM symbols"
  64.     }
  65. }
  66.